from __future__ import print_function

import sys

from dataset import create


if __name__ == '__main__':
    if len(sys.argv) > 1:
        size = 64
        assert len(sys.argv) >= 5
        if sys.argv[1] == 'create':
            if sys.argv[2] == 'local':
                if sys.argv[3] == 'train':
                    if len(sys.argv) > 5:
                        if sys.argv[5] == '--size':
                            size = int(sys.argv[6])
                    create.create_train_data(data_dir=sys.argv[4], size=size)
                elif sys.argv[3] == 'validate':
                    if len(sys.argv) > 5:
                        if sys.argv[5] == '--size':
                            size = int(sys.argv[6])
                    create.create_validation_data(data_dir=sys.argv[4], size=size)
            elif sys.argv[2] == 's3':
                if sys.argv[3] == 'train':
                    create.download_train_from_s3()
                elif sys.argv[3] == 'validate':
                    create.download_test_from_s3()